Many DXL calls operate on the current module by default. Often there is an optional parameter to specify another module to operate on. For example: |
Re: How to Set Filter State of Remote Module? Minor correction -- should be "filtering on" not "set filtering on" -- corrected below
void setFilteringStateForRemoteModule(Module thisModule,
Module remoteModule,
bool wantFilteringOn) {
if (thisModule == null) return;
if (remoteModule == null) return;
current = remoteModule;
if (wantFilteringOn) {
filtering on;
} else {
filtering off;
}
refresh current;
current = thisModule;
}
// Calls
Module remoteModule = edit("Some Other Module");
load(remoteModule, view("Some Existing View"));
setFilteringStateForRemoteModule(current, remoteModule, true);
//*** END FRAGMENT ***
|
Re: How to Set Filter State of Remote Module? Should work. But you can get the 'current' module and don't need it as a parameter
void setFilteringStateForRemoteModule(Module remoteModule,
bool wantFilteringOn) {
if (remoteModule == null) return;
Module mCurr = current()
current = remoteModule;
filtering wantFilteringOn
refresh remoteModule
if (!null mCurr) current = mCurr // current = xx will fail on a null module
}
// Calls
Module remoteModule = read("Some Other Module", true, true);
load(remoteModule, view("Some Existing View"));
setFilteringStateForRemoteModule(remoteModule, true);
//*** END FRAGMENT ***
Module mCurr = current current = mod ... deal with 'mod' as the 'current' module if (!null mCurr) current = mCurr
Module g_mOriginal = current() a: if ( null g_mOriginal) ack and halt; Run this DXL from an open module b: if (!null g_mOriginal) ack and halt; do NOT run this DXL from an open module Now you won't forget which module was originally open in which the DXL ran.
|